From 8e7fded8efe79256769159892ba290cb0aee8136 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 5 Jul 2006 10:32:08 +0100 Subject: [PATCH] [HVM][VMX] expose PSE feature to HVM guests if PAE is turned on in config file, with this change, RHEL4 IA32 SMP guest can boot. But because we don't support 4Mbytes PSE pages, so x86_32 HVM guest can NOT use PSE feature. However user may have "pae=1" in config file, which causes PSE feature seen by x86_32 HVM guest, and it will then use 4Mbytes PSE pages. In this case, we will have to crash x86_32 HVM. So when running x86_32 HVM guest, user need pay attention not to have "pae=1" in config file. Signed-off-by: Xin Li Signed-off-by: Xiaohui Xin --- xen/arch/x86/hvm/vmx/vmx.c | 10 +++++++--- xen/arch/x86/shadow.c | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index e40b76ecb5..df2e295acb 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -857,10 +857,14 @@ static void vmx_vmexit_do_cpuid(struct cpu_user_regs *regs) #else if ( v->domain->arch.ops->guest_paging_levels == PAGING_L2 ) { - if ( !v->domain->arch.hvm_domain.pae_enabled ) + if ( v->domain->arch.hvm_domain.pae_enabled ) + clear_bit(X86_FEATURE_PSE36, &edx); + else + { clear_bit(X86_FEATURE_PAE, &edx); - clear_bit(X86_FEATURE_PSE, &edx); - clear_bit(X86_FEATURE_PSE36, &edx); + clear_bit(X86_FEATURE_PSE, &edx); + clear_bit(X86_FEATURE_PSE36, &edx); + } } #endif diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index d2a65f51df..29895195fd 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -3724,7 +3724,13 @@ static inline int guest_page_fault( } if ( guest_l2e_get_flags(*gpl2e) & _PAGE_PSE ) + { + printk("None-PAE HVM guests can NOT use PSE, " + "because we don't support 4MBytes PSE pages.\n"); + printk("remove pae=1 from your config file.\n"); + domain_crash_synchronous(); return 0; + } __guest_get_l1e(v, va, gpl1e); -- 2.30.2